{extend name="base" /}
{block name="body"}

<div class="am-padding am-padding-bottom-0">
	<strong class="am-text-primary am-text-lg">网站设置</strong> / <small>基本信息</small>
</div>

<div class="am-padding am-btn-toolbar">
	<div class="am-btn-group am-btn-group-xs">
		<a href="{:url('admin/Website/index')}" class="am-btn am-btn-default"><span class="am-icon-list"></span> 设置</a>
	</div>
</div>

<form class="am-form"  action="{:url('admin/Website/index')}" method="post">
	<fieldset>
		
		{volist name="group" id="vo"}
		<div class="am-tab-panel am-fade {eq name='$key' value='0'}am-in am-active{/eq}" id="tab-{$vo.id}">					
			{volist name="vo['item']" id="v"}
				{switch $v.type}
					{case text}
						<div class="am-form-group">
							<div class="am-input-group">
								<span class="am-input-group-label">{$v.name}</span>
								<input type="text" name="value[{$v.id}]" class="am-form-field" value="{$v.value}" placeholder="{$v.tips}">
								<span class="am-input-group-label">{$v.tips}</span>
							</div>
						</div>
					{/case}
					{case textarea}
						<div class="am-form-group">
							<div class="am-input-group">
								<span class="am-input-group-label">{$v.name}</span>
								<textarea name="value[{$v.id}]" rows="5" placeholder="{$v.tips}">{$v.value}</textarea>
							</div>
						</div>
					{/case}
					
					{case editor}
						<div class="am-form-group">
							<div class="am-input-group">
								<span class="am-input-group-label">{$v.name}</span>
								<textarea name="value[{$v.id}]" rows="5" placeholder="{$v.tips}">{$v.value}</textarea>
							</div>
						</div>
					{/case}
					
					<!--
					{case editor}
						<div class="am-form-group">
							<div class="am-input-group">
								<span class="am-input-group-label">{$v.name}</span>
								<div id="wangeditor">
									{$v.value|raw}
								</div>
								<textarea id="ipt-wangeditor" name="value[{$v.id}]" class="am-hide"></textarea>
							</div>
						</div>
					{/case}
					-->
					{case select}
						<div class="am-form-group">
							<div class="am-input-group">
								<span class="am-input-group-label">{$v.name}</span>
								<select name="value[{$v.id}]">
									{volist name="$v['setup_options']" id="op"}
									<option value="{$op.val}" {eq name="$op.val" value="$v.value"}selected{/eq}>{$op.title}</option>
									{/volist}
								</select>
								<span class="am-input-group-label">{$v.tips}</span>
							</div>
						</div>
					{/case}
					{case radio}
						<div class="am-form-group">
							<div class="am-input-group">
								<span class="am-input-group-label">{$v.name}</span>
								<div class="am-form-field">
									{volist name="$v['setup_options']" id="op"}
									<label class="am-radio-inline">
										<input type="radio" name="value[{$v.id}]" value="{$op.val}" data-am-ucheck {eq name="$op.val" value="$v.value"}checked{/eq}> {$op.title}
									</label>
									{/volist}
								</div>
								<span class="am-input-group-label">{$v.tips}</span>
							</div>
						</div>
					{/case}
					{case checkbox}
						<div class="am-form-group">
							<div class="am-input-group">
								<span class="am-input-group-label">{$v.name}</span>
								<div class="am-form-field">
									{volist name="$v['setup_options']" id="op"}
									<label class="am-checkbox-inline">
										<input type="checkbox" name="value[{$v.id}]" value="{$op.val}" data-am-ucheck {eq name="$op.val" value="$v.value"}checked{/eq}> {$op.title}
									</label>
									{/volist}
								</div>
								<span class="am-input-group-label">{$v.tips}</span>
							</div>
						</div>
					{/case}
					{case image}
						<div class="am-form-group am-form-file">
							<div class="am-input-group">
								<span class="am-input-group-label">{$v.name}</span>			
								<input type="text" name="value[{$v.id}]" value="{$v.value}" class="am-form-field" placeholder="{$v.tips}" id="ipt-image-{$v.id}">
								<div class="am-input-group-label am-form-input-image">
									<img {empty name="$v.value"}src="/static/common/images/upload.png"{else/}src="{$v.value}"{/empty} alt="upload" class="am-img-thumbnail" id="view-image-{$v.id}">
									<input type="file" class="ajax-upload-file" data-url="{:url('api/Upload/index')}" data-dir="image" data-purpose="system" data-allowext="{$v.setup['allowext']}" data-ipt="#ipt-image-{$v.id}" data-src="#view-image-{$v.id}" data-thumb="false">
								</div>							
							</div>
						</div>
					{/case}
					{case file}
						<div class="am-form-group am-form-file">
							<div class="am-input-group">
								<span class="am-input-group-label">{$v.name}</span>			
								<input type="text" name="value[{$v.id}]" value="{$v.value}" class="am-form-field" placeholder="{$v.tips} 允许上传：{$v.setup['allowext']}" id="ipt-file-{$v.id}">
								
								<div class="am-input-group-label am-form-input-image">
									<button type="button" class="am-btn am-btn-danger am-btn-sm">
										<i class="am-icon-cloud-upload"></i> 选择要上传的文件
									</button>
									<input type="file" class="ajax-upload-file" data-url="{:url('api/Upload/index')}" data-dir="file" data-purpose="system" data-allowext="{$v.setup['allowext']}" data-ipt="#ipt-file-{$v.id}" data-thumb="false">
								</div>
							</div>
						</div>
					{/case}
					{case datetime}
						<div class="am-form-group">
							<div class="am-input-group">
								<span class="am-input-group-label">{$v.name}</span>
								<input type="text" name="value[{$v.id}]" value="{$v.value}" class="am-form-field" placeholder="YYYY-MM-DD" data-am-datepicker="{locale: 'en_US'}" readonly/>
								<span class="am-input-group-label">{$v.tips}</span>
							</div>
						</div>
					{/case}
				{/switch}
				
			
			{/volist}
		</div>
		{/volist}
	
		<p><button type="reset" class="am-btn am-btn-default">重置</button> <button type="submit" lay-submit lay-filter="submit" class="am-btn am-btn-default">更新</button></p>
	</fieldset>
</form>


{/block}
{block name="js"}
	<script type="text/javascript" src="/static/lib/wangEditor/wangEditor.min.js"></script>
{/block}
{block name="script"}
<!--
<script type="text/javascript">
	var E = window.wangEditor;

	var editor = new E('#wangeditor');
	editor.customConfig.debug = location.href.indexOf('wangeditor_debug_mode=1') > 0;
	editor.customConfig.uploadImgServer = "{:url('api/Upload/wangEditer')}";
	editor.customConfig.uploadImgMaxSize = 3 * 1024 * 1024;
	editor.customConfig.customAlert = function (info) {
		layer.msg(info);
	}

	var iptWangeditor = $('#ipt-wangeditor');

	editor.customConfig.onchange = function (html) {
		// 监控变化，同步更新到 textarea
		iptWangeditor.val(html);
	}

	editor.create();
	
	iptWangeditor.val(editor.txt.html());
	
</script>
-->
{/block}